<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">

    // Load the Visualization API and the controls package.
    google.load('visualization', '1.0', {'packages':['controls']});

    // Set a callback to run when the Google Visualization API is loaded.
    google.setOnLoadCallback(drawDashboard);

    // Callback that creates and populates a data table,
    // instantiates a dashboard, a range slider and a pie chart,
    // passes in the data and draws it.
    function drawDashboard() {

      // Create our data table.
      var data = google.visualization.arrayToDataTable(<?=$resultados;?>);

      // Create a dashboard.
      var dashboard = new google.visualization.Dashboard(
          document.getElementById('dashboard_div'));

      
      // Define a category picker control for the Gender column
        var categoryPicker = new google.visualization.ControlWrapper({
          'controlType': 'CategoryFilter',
          'containerId': 'picker_div',
          'options': {
            'filterColumnLabel': 'RESPUESTA',
            'ui': {
              'caption' : 'TODOS',
              'labelStacking': 'vertical',
              'allowTyping': false,
              'allowMultiple': true
            }
          }
        });
      
      //Creando la tabla
      var table = new google.visualization.ChartWrapper({
        'chartType': 'Table',
        'containerId': 'table_div',
        'options': {
          'width': '600px'
        }
      });

      // Establish dependencies, declaring that 'filter' drives 'pieChart',
      // so that the pie chart will only display entries that are let through
      // given the chosen slider range.
      dashboard.bind(categoryPicker, table);

      // Draw the dashboard.
      dashboard.draw(data);
}
</script>
<div class="container" style="width:90%">
    
    <h1>Gr&aacute;ficas</h1>
    <br/>
    
    <div id="dashboard_div">
      <div id="filter_div"></div>
      <div id="chart_div"></div>
      <div id="picker_div"></div>
      <div id="table_div"></div>
    </div>
    
    <br/><br/><br/><br/>
 
</div>